<?php
namespace Home\Controller;
use Common\Controller\BaseController;
use Think\Controller;
class OwnerController extends BaseController {

    public function index() {
        if(is_login()){
            //通过用户ID获取用户主页相关信息
            $user = json_decode($this->http->curl_request(BASE_URL.'owner/'.$_SESSION['user_login']['objectId']),true);
            if(isset($user['code'])){
                if($user['code'] == 200){
                    if(!strpos($user['results']['avatar'],':')){
                        $user['results']['avatar'] = 'http://7xlaxq.com1.z0.glb.clouddn.com/'.$user['results']['avatar'];
                    }
                    $this->assign('user',$user['results']);
                }
            }
            $this->display('owner');
        }else{
            $this->display('Login/login');
        }
    }



}